<template>
 <div class="kindbox">
    <left-box :goods-list="goodsList" @getdata="getData"></left-box>
    <router-view :itemList="itemList" ></router-view>
 </div>
</template>
 
<script>
import leftBox from './leftbox.vue';
import rightBox from './rightbox.vue';
import axios from 'axios';
export default {
    data(){
        return {
            goodsList:[],
            itemList:[]
        }
    },
    async mounted() {
//获取第一次请求是右边栏信息
            this.$http.get({
                url: '/goods/category/main.html',
                params:{
                do: "getChildren",
                    owner: this.$router.history.current.params.id-0,
                    pet_type: "cat",
                    issite: true,
                    version: 358,
                    system: "wap",
                    isWeb: 1,
                    distinct_id: "17685498279c38-070e7217d2903e-6d112d7c-1296000-1768549827abe7",
                    _: "160896647692"

                }
            }).then(res=>{
                this.itemList = res.cate_list
            })
    },
    methods:{
        
        getData(data) {
            this.itemList = data;
        }
    },
    components:{
        'left-box':leftBox,
        'right-box':rightBox
    }
}
</script>
 
<style scoped lang = "stylus">
.kindbox 
    display flex
   
</style>